<?php $this->pageTitle = 'Account Registration'; ?>
<div id="account-identify" class="bg-sky bg-position-bottom">
    <div class="container_12 relative">
        <?php
        $form = $this->beginWidget('CActiveForm', array(
            'id' => 'identify-form',
            'enableAjaxValidation' => false,
            'htmlOptions' => array(
                'class' => 'form',
            )
                ));
        ?>
        <div class="grid_8">
            <div id="account-identify-left">
                <div class="banner">
                    <h3 class="pad15-x pad10-y">Power Up Your Real Estate Business in <span class="green">30 seconds</span></h3>
                </div>
                <div class="contents pad15-x pad10-y">
                    <h4><span class="step">STEP 1 of 2:</span> Enter your CEA Registration Number</h4>
                    <table class="table">
                        <tbody>
                            <tr>
                                <td width="135" class="align-right"><label>CEA Registration No.:</label></td>
                                <td>
                                    <?php echo CHtml::textField('license_no', null, array('id' => 'license_no', 'size' => 20, 'class' => 'float-left')); ?>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <hr/>
                    <p>
                        <?php echo CHtml::submitButton('Proceed', array('class' => 'orange-button small')); ?>&nbsp;&nbsp;&nbsp;Already have an account? <a href="<?php echo $this->createUrl('/account/login'); ?>">Sign in here</a>
                    </p>

                </div>
            </div>
            <div id="account-identify-video" class="align-center">
                <h4>What is PropSage? Play the video below to find out</h4>
                <a href="#videoOverlay" class="playVideo">
                    <img src="<?php echo Yii::app()->baseUrl; ?>/images/home/macbook_play.png" />
                </a>
                <div style="display:none">
                    <?php
                    $iPhone = strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone');
                    $iPad = strpos($_SERVER['HTTP_USER_AGENT'], 'iPad');

                    if ($iPhone == true || $iPad == true):
                        ?>
                        <div id="videoOverlay">
                            <video id='video'
                                   controls preload='none'
                                   width="640" height="480">
                                <source id='m4v'
                                        src="/media/videos/commercial.m4v"
                                        type="video/mp4"></source>
                                <source id='mov'
                                        src="/media/videos/commercial.mov"
                                        type="video/quicktime"></source>
                                <p>Your user agent does not support the HTML5 Video element.</p>
                            </video>
                            <script type="text/javascript">
                                $(function(){
                                    $('.playVideo').fancybox({
                                        'autoDimensions': false,
                                        'autoScale'     : false,
                                        'width'     : 650,
                                        'height'    : 500
                                    });
                                });
                            </script>
                        </div>
                    <?php else: // Flash-enabled browsers ?>
                        <!-- video-overlay:start -->
                        <div id="videoOverlay">
                            <div id="jwplayer" style="width: 640px; height: 480px;"></div>
                            <script type="text/javascript">
                                $(function(){
                                    $('.playVideo').fancybox({
                                        'autoDimensions': false,
                                        'autoScale'     : false,
                                        'width'     : 650,
                                        'height'    : 500,
                                        'onComplete'    : function(){
                                            jwplayer("jwplayer").setup({
                                                file:"/media/videos/commercial.flv",
                                                flashplayer: "/js/player.swf",
                                                allowscriptaccess: "always",
                                                allowfullscreen: true,
                                                width: 640,
                                                height: 480,
                                                //                    controlbar: 'bottom',
                                                plugins: {
                                                    'viral-2': {
                                                        onpause: false,
                                                        oncomplete: false,
                                                        allowmenu: false
                                                    }
                                                }
                                            });
                                            jwplayer("jwplayer").play();
                                        },
                                        'onClosed'      : function() {
                                            //                                    jwplayer("jwplayer").stop();
                                        }
                                    });

                                    $('.playVideo').click(function(event){
                                        event.preventDefault();
                                    });
                                });
                            </script>
                        </div>      
                        <!-- video-overlay:end -->
                    <?php endif; ?>
                </div>
            </div>
        </div>
        <div  id="account-identify-right" class="grid_4">
            <?php $this->renderPartial('_testimonials', array('referrer' => $referrer)); ?>
        </div>
        <?php $this->endWidget(); ?>
    </div>
</div>